package reduce.fz.com.reduce.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.bean.MyTeam;
import reduce.fz.com.reduce.custom.HeaderFooterStatusRecyclerViewAdapter;
import reduce.fz.com.reduce.util.PicassoUtil;

/**
 * Created by qingshengzheng on 15/8/9.
 */
public class MyTeamsAdapter extends HeaderFooterStatusRecyclerViewAdapter<AbstractRecycleHolder> {
    private List<MyTeam> myteams;
    private LayoutInflater layoutInflater;
    private Context context;

    public MyTeamsAdapter(Context context, List<MyTeam> myteams) {
        layoutInflater = LayoutInflater.from(context);
        this.myteams = myteams;
        this.context = context;
    }

    public static class MyTeamHolder extends AbstractRecycleHolder<MyTeam> {
        private ImageView iv_team_image = null;
        private TextView tv_team_title = null;

        public MyTeamHolder(View itemView, RecyclerView.Adapter adapter) {
            super(itemView, adapter);
            iv_team_image = (ImageView) itemView.findViewById(R.id.iv_team_image);
            tv_team_title = (TextView) itemView.findViewById(R.id.tv_team_title);

        }

        @Override
        public void renderView(MyTeam bean) {
            //PicassoUtil.laodUrl(itemView.getContext(), bean.getTeaminfo().getImageurl(), iv_team_image);
            //tv_team_title.setText(bean.getTeaminfo().getTitle());

        }

        @Override
        public void initView() {

        }
    }


    @Override
    public AbstractRecycleHolder createFooterStatusViewHolder(View footerView) {
        return new AbstractRecycleHolder(footerView) {
            @Override
            public void renderView(Object bean) {

            }

            @Override
            public void initView() {

            }
        };
    }

    @Override
    protected int getHeaderItemCount() {
        return 0;
    }

    @Override
    protected int getContentItemCount() {
        return myteams.size();
    }

    @Override
    protected AbstractRecycleHolder onCreateHeaderItemViewHolder(ViewGroup parent, int headerViewType) {
        return null;
    }

    @Override
    protected AbstractRecycleHolder onCreateContentItemViewHolder(ViewGroup parent, int contentViewType) {
        View view = layoutInflater.inflate(R.layout.myteam_card_view, parent);
        return null;
    }

    @Override
    protected void onBindHeaderItemViewHolder(AbstractRecycleHolder headerViewHolder, int position) {

    }

    @Override
    protected void onBindContentItemViewHolder(AbstractRecycleHolder contentViewHolder, int position) {
        contentViewHolder.renderView(myteams.get(position));

    }
}
